package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelPictureActivity;
import flc.ast.activity.SelVideoActivity;
import flc.ast.databinding.FragmentToolBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> {

    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.llAddText.setOnClickListener(this);
        mDataBinding.llPicDoodle.setOnClickListener(this);
        mDataBinding.llAddSticker.setOnClickListener(this);
        mDataBinding.llPicBackground.setOnClickListener(this);
        mDataBinding.llGifMake.setOnClickListener(this);
        mDataBinding.llVideoSpeed.setOnClickListener(this);
        mDataBinding.llVideoUpend.setOnClickListener(this);
        mDataBinding.llVideoCut.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.llAddText://添加文字
                SelPictureActivity.type = 1;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.llPicDoodle://图怕画笔
                SelPictureActivity.type = 2;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.llAddSticker://添加贴纸
                SelPictureActivity.type = 3;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.llPicBackground://图片背景
                SelPictureActivity.type = 4;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.llGifMake://gif制作
                SelVideoActivity.type = 1;
                startActivity(SelVideoActivity.class);
                break;
            case R.id.llVideoSpeed://视频变速
                SelVideoActivity.type = 2;
                startActivity(SelVideoActivity.class);
                break;
            case R.id.llVideoUpend://视频倒放
                SelVideoActivity.type = 3;
                startActivity(SelVideoActivity.class);
                break;
            case R.id.llVideoCut://视频剪切
                SelVideoActivity.type = 4;
                startActivity(SelVideoActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}